// import 'package:bloc/bloc.dart';
// import 'package:flutter/cupertino.dart';
// import 'package:flutter_roujiaosuo/events/weather_event.dart';
// import 'package:flutter_roujiaosuo/models/weather_model.dart';
// import 'package:flutter_roujiaosuo/repositorys/weatherRepository.dart';
// import 'package:flutter_roujiaosuo/states/weather_state.dart';

// class WeatherBloc extends Bloc<WeatherEvent, WeatherState> {
//   final WeatherRepository weatherRepository;
//   WeatherBloc({@required this.weatherRepository})
//       : assert(weatherRepository != null),
//         super();
//   @override
//   // TODO: implement initialState
//   WeatherState get initialState => WeatherEmpty();
//   @override
//   Stream<WeatherState> mapEventToState(WeatherEvent event) async* {
//     // TODO: implement mapEventToState
//     if (event is FetchWeather) {
//       yield WeatherLoading();
//       try {
//         Weather weather = await weatherRepository.getWeather(event.city);
//         WeatherLoaded loaded = WeatherLoaded(weather: weather);
//         yield loaded;
//       } catch (e) {
//         yield WeatherError();
//       }
//     }
//   }
//   // @override
//   // Stream<WeatherState> mapEventToState(WeatherState currentState,WeatherEvent event) async* {
//   //   // TODO: implement mapEventToState

//   //   return null;
//   // }
// }
